import {instance} from "@/api/request.js";

const url = "/auth";

export function login(account, password) {
    return instance.post(url+"/login", null, {
        params: {
            account: account,
            password: password
        }
    });
}
export function logout() {
    return instance.post(url+"/logout");
}

export function getUserInfo(id) {
    return instance.get(url+"/login/user/"+id, {});
}

export function getUser() {
    return instance.get(url+"/user", {});
}

// 查询好友信息
export function getRelation() {
    return instance.get(url+"/relation/01");
}
// 查询我的关注
export function getMyAttention() {
    return instance.get(url+"/relation/11");
}
// 查询我的粉丝
export function getMyFans() {
    return instance.get(url+"/relation/21");
}
// 查询是否关注
export function getIsAttention(id) {
    return instance.get(url+"/relation/1"+id);
}

// 发送注册验证码
export function sendSignInCaptcha(email) {
    return instance.post(url+"/captcha/"+email+"/signIn");
}
// 发送忘记密码验证码
export function sendForgotPassCaptcha(email) {
    return instance.post(url+"/captcha/"+email+"/forgot");
}
